1. Field of the Invention
The present invention relates to an image data encoding apparatus and an image data encoding method.
2. Related Background Art
Included in an image, particularly a multi-valued image, is a great amount of information, and an enormous amount of space is required to store or transmit the data for such an image. Therefore, to facilitate the storage or transmission of image data, the amount of data that must be handled is reduced by using a high-efficiency encoding process whereby image redundancies are removed, or another one whereby the image data are compressed in such a manner that some data are lost, but the degree of loss is such that the resulting deterioration of the image quality is extremely difficult to detect visually.
One well known, high-efficiency encoding method is the JPEG compression encoding method. According to this method, a multi-valued image is divided into blocks and a DCT transform performed for each block, and the obtained frequency component is quantized for variable length coding.
A problem with coding that employs a DCT transform is that when a high compression rate is set distortion occurs in a block in a decoded image. Recently, to remove this distortion, a new encoding method using a wavelet transform has been proposed.
Further, variable length coding is frequently employed as a part of these various high-efficiency coding methods.
However, a simple process by which to employ a method for the variable length coding of a multi-valued image, and a circuit configuration by which variable length coding can be performed rapidly have not yet been established.
To resolve the conventional problems, it is one objective of the present invention to provide a configuration for easily and rapidly performing variable length coding for a multi-valued image, and in particular, for easily and rapidly performing a determination process for estimating coding efficiency and for determining, as needed, a parameters to be used for coding.
To achieve the above objective, according to the present invention, an encoding apparatus for an image processing apparatus, one which encodes a plurality of sets of multi-valued image data (corresponding to the quantized values for one sub-block in the preferred embodiments of this invention) to produce code having variable lengths (corresponding to Golomb code in the embodiments) based on the multi-valued image data and a parameter k (corresponding to parameter k in the embodiments), comprises:
a bit shift unit (corresponding to a unit 501a in the embodiments) for performing bit shifts for each of the multi-valued image data sets a different number of times (0 to a times in the embodiments) in accordance with the parameter k (corresponding to k=0 to a in the embodiments) and for outputting P sets ((a+1) sets in the embodiments) of data;
P accumulation adders (corresponding to those units labeled 502a to 502z in the embodiments) for accumulating the P sets of data in correlation with the parameter k, for each of the multi-valued data sets (for each sub-block in the embodiments); and
comparators (corresponding to those units labeled 503a to 503z in the embodiments) for comparing the results obtained by the accumulation adders to determine an optimal parameter k for each of the multi-valued image data sets.
In addition, to achieve the above objective, according to the present invention an encoding apparatus, which employs one of a plurality of coding parameters to encode a plurality of sets of multi-valued image data to obtain coded data having a fixed length code portion and a variable length code portion, comprises:
a calculation unit for calculating in parallel, for each of the coding parameters, the total amount of code that is obtained when the multi-valued image data are encoded;
a detection unit for detecting the smallest total amount of code provided by the calculation unit when calculating the total amounts of code; and
a holding unit for storing a value representing a coding parameter that corresponds to the smallest total amount of code identified by the detection unit.
Other objectives and features of the present invention will become obvious during the course of the following explanation of the preferred embodiments, given while referring to the accompanying drawings.